package org.vaadinetherealintegration;


import com.vaadin.Application;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.CloseEvent;
import com.vaadin.ui.Window.CloseListener;

/**
 * The Application's "main" class
 * 
 * @author Jesus R Martinez (jesusrmartinez51@gmail.com)
 */
@SuppressWarnings("serial")
public class WidgetTestApplication extends Application
{
    private Window window;

    @Override
    public void init()
    {
        window = new Window("Widget Test");
        window.setImmediate(true);
        setMainWindow(window);
        
        getMainWindow().setContent(new ViewLayout());
        
        getMainWindow().addListener(new CloseListener(){

			public void windowClose(CloseEvent e) {
				// TODO Auto-generated method stub
				e.getWindow().removeAllComponents();
				removeWindow(e.getWindow());
				close();
			}
        	
        });
    }
    
}
